Sparkplug Awareness plugin
The Sparkplug specification version 3.0 has certain requirements of an MQTT broker to be usable for Sparkplug.
The first category is "Sparkplug Compliance", which means that the broker supports basic MQTT features. Any MQTT compliant broker should also be Sparkplug compliant.
The second category is "Sparkplug Aware", which requires that certain Sparkplug
messages are automatically republished by the broker on a different topic. This
relates to all NBIRTH
and DBIRTH
messages, and provides a mechanism to have
a persistent store of birth certificates.
More specifically, all messages published matching the topic
spBv1.0/+/NBIRTH/+
or spBv1.0/+/DBIRTH/+/+
will be republished on the same
topic, but prefixed with $sparkplug/certificates/
. In other words, a message
published on spBv1.0/group_id/NBIRTH/edge_node_id
would be republished on
$sparkplug/certificates/spBv1.0/group_id/NBIRTH/edge_node_id
Sparkplug awareness would not be part of a standard MQTT broker and is typically provided as an extension.
Mosquitto is Sparkplug compliant out of the box without any configuration.
For Sparkplug awareness support, Mosquitto provides a plugin.
Plugin configuration
To enable the plugin it must be loaded into the broker with, by adding the
following to your mosquitto.conf
:
global_plugin /usr/lib/mosquitto_sparkplug_aware.so
There is no further configuration required.